﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VOL.Entity.DomainModels.HealthEducation
{
    [Table("BroadCastTemplate")]
    public class BroadCastTemplate
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required]
        [StringLength(30, ErrorMessage = "模板名称不能超过30个字符")]
        public string TemplateName { get; set; }

        [ForeignKey(nameof(BroadType))] // 关联广播类型表（可空）
        public int? BroadCastTypeId { get; set; }

        [Required]
        public string BroadCastContent { get; set; }

        [Required]
        [StringLength(300)]
        public string FileUrl { get; set; }

        [Range(1, int.MaxValue, ErrorMessage = "排序值必须大于0")]
        public int? SortId { get; set; } // 可空排序字段

        [Required]
        [Range(0, 1, ErrorMessage = "启用状态只能是0或1")]
        public int IsUse { get; set; } // 1启用 0停用

        public DateTime CreateTime { get; set; }

    }
}
